from sgmllib import SGMLParser
class URLLister(SGMLParser):
    """
    from urllister import URLLister
    parser = URLLister()
    parser.feed(content)
    <return list> parser.urls()
    """
    def reset(self):                              
        SGMLParser.reset(self)
        self.urls = []

    def start_a(self, attrs):                    
        href = [v for k, v in attrs if k=='href'] 
        if href:
            self.urls.extend(href)
